<template>
  <div class="form-horizontal">
    <ExtraBaseInfo ref="extrabaseinfo" :editable="isEditable" v-bind:extrabaseinfo="editExtraInfo.extrabaseinfo"></ExtraBaseInfo>
    <RewardsHis ref="rewards" :editable="isEditable" v-bind:rewards="editExtraInfo.rewards"></RewardsHis>
  </div>
</template>
<script>
import ExtraBaseInfo from '../../mycomponents/extrainfo/ExtraBaseInfo'
import RewardsHis from '../../mycomponents/extrainfo/RewardsHis'
export default {
  name: 'ExtraInfo',
  props: ['extrainfo','editable'],
  data: function() {
    return {
      isEditable:true,
      editExtraInfo: this.extrainfo
    }
  },
  components: {
    ExtraBaseInfo,
    RewardsHis
  },
  created:function(){
    if(this.editable != null && this.editable != undefined){
      this.isEditable = this.editable
    }
  },
  methods: {
    getData() {
      var extraBaseInfo =this.$refs.extrabaseinfo.getData()
      var rewards = this.$refs.rewards.getData()
      if(!extraBaseInfo){
        return null
      }
      this.editExtraInfo.extrabaseinfo = extraBaseInfo
      this.editExtraInfo.rewards = rewards
      return this.editExtraInfo
    }
  }
}
</script>
